<?php

use yii\helpers\Inflector;
use yii\helpers\StringHelper;

/* @var $this yii\web\View */
/* @var $generator yii\gii\generators\crud\Generator */

echo "<?php\n";
?>

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model <?= ltrim($generator->searchModelClass, '\\') ?> */
/* @var $form yii\widgets\ActiveForm */
?>


    <?= "<?php " ?>$form = ActiveForm::begin([
        'action' => [\Yii::$app->controller->action->id],
        'method' => 'get',
    ]); ?>

<?php
$count = 0;
foreach ($generator->getColumnNames() as $attribute) {
    if (++$count < 6) {
        echo "    <?= " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
    } else {
        echo "    <?php // echo " . $generator->generateActiveSearchField($attribute) . " ?>\n\n";
    }
}
?>

    <?= "<?php " ?>
      echo $form->field($model, 'created_at_start')->widget(\yii\jui\DatePicker::classname(), [
        'language' => 'zh-CN',
        'dateFormat' => 'yyyy-MM-dd',
        'options'=>['class'=>'form-control'],
      ]);
    ?>

    <?= "<?php " ?>
      echo $form->field($model, 'created_at_end')->widget(\yii\jui\DatePicker::classname(), [
        'language' => 'zh-CN',
        'dateFormat' => 'yyyy-MM-dd',
        'options'=>['class'=>'form-control'],
      ]);
    ?>

    <div class="form-group">
        <?= "<?= " ?>Html::submitButton(<?= $generator->generateString("搜索") ?>, ['class' => 'btn btn-success']) ?>
        <?= "<?= " ?>Html::resetButton(<?= $generator->generateString('重置') ?>, ['class' => 'btn btn-default']) ?>
    </div>

    <?= "<?php " ?>ActiveForm::end(); ?>

